package com.itheima.thread15;

import java.util.concurrent.ArrayBlockingQueue;

public class Foodier extends Thread{
    private ArrayBlockingQueue<String> arrayBlockingQueue;

    public Foodier(ArrayBlockingQueue<String> arrayBlockingQueue) {
        this.arrayBlockingQueue=arrayBlockingQueue;
    }

    @Override
    public void run() {
        while(true){
            try {
                System.out.println("吃货拿了一个"+arrayBlockingQueue.take());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
